<div id="sidebar">
        		<?php if(isset($products_best_sales) && $products_best_sales != null) {?>
                <div class="b-sidebar">
                	<div class="titile-news">Sản phẩm bán chạy</div>
                    <ul class="list-sp">
                        <?php
                            $CI =& get_instance();
                            $products_best_sales = $CI->db->select()->from("products")->where(array('status' => 'yes','best_sales' => 'yes'))->order_by('date_create','desc')->limit(5)->get()->result();
                        ?>
                    	<?php foreach($products_best_sales as $k => $v) {?>
                    	<li>
                            <?php
                                $img = $CI->db->select()->from('images_products')->where('id_product',$v->id)->get()->row();
                            ?>
                    		<a href="<?php echo base_url().'show-room/detail/'.$v->id.'/'.$v->name_link.'.html';?>" title="<?php echo $v->name;?>">
                        		<img src="<?php echo ($img ? site_url($img->img_path) : '');?>" onerror="this.src='<?php echo img_link("no_image.gif");?>'" title="<?php echo $v->name;?>" alt="<?php echo $v->name;?>" class="thumb" />
                        	</a>
                            <span class="info"><a href="<?php echo base_url().'show-room/detail/'.$v->id.'/'.$v->name_link.'.html';?>"><?php echo $v->name;?></a><br /> <b><?php echo format_type_money($v->price);?> VND</b></span>
                        </li>
                        <?php }?>
                        <?php }?>  

                    </ul>
                </div>
                
                <?php if(isset($questions) && $questions != null) {?>
                <div class="b-sidebar">
                	<div class="titile-news">Tư vấn - Hỏi đáp</div>
                    <div class="show-qa">
                    	<b style="color:#444;"><?php echo $questions[0]->fullname;?></b> - <font class="date"><?php echo date('d-m-Y', strtotime($questions[0]->date_create)); ?></font><br>
                    	<a href="<?php echo base_url().'tu-van-hoi-dap/detail/'.$questions[0]->id.'/'.$questions[0]->title_link.'.html';?>" title="<?php echo $questions[0]->title;?>">
                    		<?php echo character_limiter($questions[0]->title,100);?>
                    	</a>
                        <div class="b-question">
                            <div class="i-arrow2"><span></span></div>
                            <div class="ct-qs2">
                            	<?php echo character_limiter($questions[0]->answers,300);?>
                            	<br /><a href="<?php echo base_url().'tu-van-hoi-dap/detail/'.$questions[0]->id.'/'.$questions[0]->title_link.'.html';?>" class="view">Xem chi tiết</a>
                            </div>
                        </div>
                    </div>
                </div>
                <?php }?>

            </div>